#ifndef DATAFRAME_H
#define DATAFRAME_H

#include <biosignal/datetime.h>
#include <biosignal/signaldata.h>
#include <biosignal/montage/montage.h>
#include <biosignal/montage/channeldata.h>

#include <tr1/memory>
#include <iterator>
#include <map>
#include <vector>
#include <list>

namespace biosignal {

using namespace std::tr1;

class BioSignal;

class DataFrame {
public:
//	typedef std::vector< shared_ptr<SignalData> >::const_iterator const_iterator;
    typedef std::vector< montage::ChannelDataType >::const_iterator const_iterator;
    //required by python
    DataFrame() {}
    DataFrame(const BioSignal* biosignal, TimePeriod bounds,
              shared_ptr<const montage::Montage> montage = shared_ptr<const montage::Montage>());
    virtual ~DataFrame();

    TimePeriod time_period() const;
    void time_period( TimePeriod time);

    shared_ptr<const montage::Montage> montage() const;
    const std::vector< shared_ptr<SignalData> >& signal_source_data() const;
    shared_ptr<const SignalData> signal_source_data(std::string signal_source_label) const;
    const_iterator begin() ;
    const_iterator end() ;
protected:
    const BioSignal* m_biosignal;
    std::vector<shared_ptr<SignalData> > m_signal_data;
    std::map<std::string, shared_ptr<SignalData> > m_signal_data_map; // signal source keyed
    void add_signaldata(SignalData* signal_data);
    TimePeriod m_time_period;
    const std::vector< montage::ChannelDataType >& channels_data();
private:
    shared_ptr<const montage::Montage> m_montage;
    std::vector< montage::ChannelDataType > m_channels_data;
};

}
#endif // DATAFRAME_H
